package com.ruoyi.community.service.ec.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.community.mapper.EcRestaurantsMapper;
import com.ruoyi.community.domain.EcRestaurants;
import com.ruoyi.community.service.ec.IEcRestaurantsService;

/**
 * 社区电商Service业务层处理
 *
 * @author ruoyi
 * @date 2021-08-15
 */
@Service
public class EcRestaurantsServiceImpl implements IEcRestaurantsService {

    @Autowired
    private EcRestaurantsMapper ecRestaurantsMapper;

    /**
     * 查询社区电商
     *
     * @param restaurantId 社区电商ID
     * @return 社区电商
     */
    @Override
    public EcRestaurants selectEcRestaurantsById(Long restaurantId)
    {
        return ecRestaurantsMapper.selectEcRestaurantsById(restaurantId);
    }

    /**
     * 查询社区电商列表
     *
     * @param ecRestaurants 社区电商
     * @return 社区电商
     */
    @Override
    public List<EcRestaurants> selectEcRestaurantsList(EcRestaurants ecRestaurants)
    {
        return ecRestaurantsMapper.selectEcRestaurantsList(ecRestaurants);
    }

    /**
     * 根据社区ID查询社区电商列表
     */
    public List<EcRestaurants> selectEcRestaurantsListByCommunity(Integer communityId)
    {
        return ecRestaurantsMapper.selectEcRestaurantsListByCommunity(communityId);
    }

    /**
     * 新增社区电商
     *
     * @param ecRestaurants 社区电商
     * @return 结果
     */
    @Override
    public int insertEcRestaurants(EcRestaurants ecRestaurants)
    {
        return ecRestaurantsMapper.insertEcRestaurants(ecRestaurants);
    }

    /**
     * 修改社区电商
     *
     * @param ecRestaurants 社区电商
     * @return 结果
     */
    @Override
    public int updateEcRestaurants(EcRestaurants ecRestaurants)
    {
        return ecRestaurantsMapper.updateEcRestaurants(ecRestaurants);
    }

    /**
     * 批量删除社区电商
     *
     * @param restaurantIds 需要删除的社区电商ID
     * @return 结果
     */
    @Override
    public int deleteEcRestaurantsByIds(Long[] restaurantIds)
    {
        return ecRestaurantsMapper.deleteEcRestaurantsByIds(restaurantIds);
    }

    /**
     * 删除社区电商信息
     *
     * @param restaurantId 社区电商ID
     * @return 结果
     */
    @Override
    public int deleteEcRestaurantsById(Long restaurantId)
    {
        return ecRestaurantsMapper.deleteEcRestaurantsById(restaurantId);
    }
}
